﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Xpus.Website.Core.Membership;
using System.Drawing;

public partial class Login : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
	}
	protected void btnLogin_Click(object sender, EventArgs e)
	{
		if(XpusMembership.CheckUser(txtUserName.Text, txtPassword.Text))
		{
			if(!string.IsNullOrEmpty(Request.QueryString["ReturnUrl"]))
				FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, chkRememberMe.Checked);
			else
				FormsAuthentication.SetAuthCookie(txtUserName.Text, chkRememberMe.Checked);
		}
		else
		{
			lblMsg.ForeColor = Color.Red;
			lblMsg.Text = "用户名或密码错误！";
		}
	}
}
